package router

import (
	"go-api/internal/middleware"
	"net/http"

	"github.com/gin-gonic/gin"

	swaggerFiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
)

func InitRouter() http.Handler {
	r := gin.New()
	r.GET("/go/api/v1/healthy", func(context2 *gin.Context) {
		context2.JSON(200, "healthy")
	})

	r.Use(middleware.ZapLogger())
	UserRouter(r)
	r.GET("/swagger/go/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	return r
}
